package handlers

import (
	"MBTIx/dba"
	"MBTIx/models"
	"net/http"

	"github.com/gin-gonic/gin"
	"github.com/jmoiron/sqlx"
)

func Get_class(c *gin.Context){
	db,_ := c.Get("db")

	var class models.Class
	var classes []models.Class
	c.ShouldBind(&class)
	dba.GetClassByDepId(db.(*sqlx.DB),class.Dep_id,&classes)

	c.JSON(http.StatusOK,classes)

}